package com.dq.repository;

import com.dq.domain.activity.Activity;
import com.dq.domain.annex.AnnexTypeEnum;
import com.dq.domain.annex.MallAnnex;
import com.dq.domain.category.Category;

import com.dq.domain.goods.Goods;
import com.dq.domain.org.Org;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @创建人 gewenzhen
 * @创建时间 2019/9/15
 * @描述
 */
public interface BaseMallAnnexRepository extends JpaRepository<MallAnnex, Long> {
    MallAnnex getByGoodsAndAnnexTypeEnumAndDeletedIsFalse(Goods goods, AnnexTypeEnum annexTypeEnum);

    List<MallAnnex> findByGoodsAndAnnexTypeEnumAndDeletedIsFalse(Goods goods, AnnexTypeEnum annexTypeEnum);

    MallAnnex getByCategoryAndAnnexTypeEnumAndDeletedIsFalse(Category category, AnnexTypeEnum annexTypeEnum);

    List<MallAnnex> findByCategoryAndAnnexTypeEnumAndDeletedIsFalse(Category category, AnnexTypeEnum annexTypeEnum);

    MallAnnex getByActivityAndAnnexTypeEnumAndDeletedIsFalse(Activity activity, AnnexTypeEnum annexTypeEnum);
}
